<div class="span12">
  <div class='group'>
	  <%= link_to("New group", new_group_path, :class => "btn btn-mini \
	  btn-primary pull-right") %>
  </div>

	<table class="table">
		<thead>
			<tr>
				<td> # </td>
				<td> Title </td>
				<td> Description </td>
				<td> Owner </td>
			</tr>
		</thead>
		<tbody>
			<% @groups.each do |group| %>
			<tr>
				<td><%= group.id %></td>
				<td><%= link_to(group.title, group_path(group)) %></td>
				<td><%= group.description %></td>
				<td><%= group.owner.name %></td>
				<td>
					<% if current_user && group.editable_by?(current_user) %>
					<%= link_to("Edit", edit_group_path(group), :class => "btn btn-mini pull-right") %>
					<%= link_to("Delete", group_path(group), :class => "btn btn-mini pull-right",\
					:method => :delete, :confirm => "Are you sure?")%>
					<% end %>
				</td>
			</tr>
			<% end %>
		</tbody>
	</table>
</div>
